home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE4 / ZAP / !Zap / Modules / !ZapBasAsm / UK / HelpData
Text File  |  2002-05-08  |  3KB  |  77 lines

  1. | ZapBASasm
  2.  
  3. mode_basasm
  4. Carl Hetherington's colouring mode for BASIC assembler.
  5. This will colour the assembler parts of untokenised BASTXT files.
  6.  
  7. BASM_LABELLIST
  8. This is the simplest of the three.  When called it simply calls the Zap
  9. search code with a search string that (hopefully) finds just label
  10. definitions.  These are sent to a throwback window for your perusal.
  11. This option can be selected from the Mode.BasAsm menu.
  12.  
  13. BASM_MULTIPLE
  14. This command is designed to find labels that have been defined more than once
  15. within a particular file.  Multiple definitions can give rise to all manner
  16. of strange errors and its worth calling this function if you have a strange
  17. bug that you can't fix.  If any multiple definitions are found they are
  18. listed in a throwback window; if labels are defined more than twice they
  19. appear more and once in the throwback window.  Note that in this version you
  20. can't click on labels in the throwback window to move to them; you'll have to
  21. use the standard search function once the multiple labels have been found.
  22. This option can also be selected from the Mode.BasAsm menu.
  23. Note that if you have labels longer than 256 characters in length then
  24. strange things may happen.
  25.  
  26. BASM_NUMBERLABEL
  27. This is a command which may or may not suit your way of working.  Because of
  28. the fact that you can't have duplicate labels in the BASIC assembler, I tend
  29. to give common labels, for example loop and skip, consecutive numbers to
  30. differentiate them.  For example there might be a sequence of code
  31.  
  32. .routine_loop1
  33. <code>
  34. BNE routine_skip1
  35. <code>
  36. .routine_skip1
  37. BLT routine_loop1
  38. .routine_loop2
  39. ...etc
  40.  
  41. The only problem with this is knowing which numbers have been used and which
  42. have not.  This is where this command comes in.  It is used when you have
  43. typed the start of a new label, e.g.
  44.  
  45. .routine_loop
  46.  
  47. If you then call BASM_NUMBERLABEL, Zap will look through the file for any
  48. other labels of the form routine_loopx, where x is a number, and will then
  49. enter the next number up in the sequence.
  50.  
  51. This sounds rather complicated, but works quite well in practice.  With the
  52. above example of code, I could then type
  53.  
  54. .routine_skip
  55.  
  56. and then call BASM_NUMBERLABEL and a 2 would be entered.
  57. Note that using numbers of more than 3 digits with this command may cause
  58. unpredictable behaviour.
  59.  
  60.  
  61. BASM_INSERTPREFIX
  62. This is another command that may or may not help you, depending on the style
  63. of source code that you write.  Because of the way I avoid duplicate labels,
  64. the label names can end up being rather long and tedious to type.  The
  65. BASM_INSERTPREFIX command, when bound to a handy key, can help.  Basically it
  66. tries to decide what the current subroutine that you are in is called, and
  67. inserts this name at the cursor.  This can be useful in situations like:
  68.  
  69. .a_long_routine_name
  70.  
  71. . [*] a_long_routine_name_loop1
  72. MOV r0,r0
  73. B [*] a_long_routine_name_loop1
  74.  
  75. Executing BASM_INSERTPREFIX at the places marked by [*] inserts
  76. 'a_long_routine_name'.  The best way to understand it is to try it out; if it
  77. doesn't work for you then just forget about it.